// 以数组的形式 返回文件夹的所有内容

var http = require('http');
var fs = require('fs');

var hostname = '127.0.0.1';
var port = '3000';

var server = http.createServer( function ( req,res ) {
    var files=fs.readdirSync('./imgs');

    console.log(files);
    var wjj=[];

    for (var i = 0; i < files.length; i++) {
        var stats=fs.statSync('./imgs/'+files[i]);
        if(stats.isDirectory()){
            wjj.push(files[i]);
        }
    };

    console.log(wjj);

    res.end();
});

server.listen(port,hostname);